package fr.generali.poc.statemachine.proxy;

import org.apache.camel.Exchange;

import fr.generali.poc.statemachine.model.Dossier;

public class FueProxy implements IFueProxy {
	private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory
			.getLogger(FueProxy.class);

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.generali.poc.statemachine.proxy.IFueProxy#creerSuspens(fr.generali
	 * .poc.statemachine.model.Dossier)
	 */
	@Override
	public Dossier creerSuspens(Dossier d) {
		LOGGER.debug("dans la methode creerSuspens ");
		return d;
	}

	@Override
	public Dossier creerSuspens(Exchange d) {

		LOGGER.debug("dans la methode updateSuspens avec Camel et Exchange");
		Dossier vDoss = (Dossier) d.getIn().getBody();
		vDoss.setDonnees("SUSPENS");
		return vDoss;
	}

	@Override
	public Dossier updateSuspens(Dossier d) {
		// try {
		// Thread.sleep(2000);
		// } catch (InterruptedException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }

		LOGGER.debug("dans la methode updateSuspens");
		d.setDonnees("SUSPENS");
		return d;
	}
}
